package one.stand.service;

import com.alibaba.fastjson.JSON;
import one.stand.OneUserServiceApplicationTests;
import one.stand.mapper.GoodSpecMapper;
import one.stand.model.GoodSpecModel;
import one.stand.request.GoodSpecRequest;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.TestConfiguration;

@TestConfiguration
public class GoodSpec extends OneUserServiceApplicationTests {
    @Autowired
    GoodSpecMapper goodSpecMapper;
    @Autowired
    GoodsService goodsService;
    @Test
    public void getSpec() {

        System.err.println(JSON.toJSON(goodSpecMapper.getSpec(new GoodSpecModel() {{
            setGoodsId(1);
        }})));
    }
    @Test
    public void getGoodesCard(){
        System.err.println(JSON.toJSONString(goodsService.goodsCard(new GoodSpecRequest(){{
            setSpecId(171);
            setId(111L);
        }})));
    }
}
